package main

import (
	"encoding/gob"
	"luiz/crawler/engine"
	"luiz/crawler/model"
	"luiz/crawler/scheduler"
	"luiz/crawler/ziru/parser"
	"luiz/crawler_distributed/config"
	"luiz/crawler_distributed/persist/client"
)

func main() {
	//c := engine.ConcurrentEngine{Scheduler: &scheduler.QueueScheduler{},
	//	WorkerCount: 10}
	gob.Register(model.House{})
	saver, _ := client.ItemSaver(":1234")
	c := &engine.ConcurrentEngine{Scheduler: &scheduler.SimpleScheduler{},
		WorkerCount: 10, ItemChan: saver, RequestProcessor: engine.Worker}

	c.Run(engine.Request{"http://gz.ziroom.com/z/z1/?isOpen=0", engine.NewFuncParser(parser.ParseCityList, config.ParseCityList)})
}

//根据reader 来返回encoding
